package com.itheima.charstream;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class Demo01 {

    public static void main(String[] args) throws UnsupportedEncodingException {
        String s="今天天气很好a";
        //编码 gbk
        byte[] bytes = s.getBytes();
        System.out.println(Arrays.toString(bytes));
        //解码 utf-8
        String s1 = new String(bytes,"GBK");
        System.out.println(s1);


    }
}
